Set provider prefix on creation and when editing a provider with no topics#676
Set provider prefix on creation and when editing a provider with no topics#676FionaLMcLaren wants to merge 1 commit intomainfrom
Conversation
…opics Resolves #607 Each provider has a `file_name_prefix`. This value is added to the file name when the provider uploads a file. This `file_name_prefix` is necessary to coordinate between our file storage and Azure's. However, if a provider was to change their `file_name_prefix` when they had uploaded files, it would break management of those existing uploaded files. Before, we got around this by simply removing the field from the provider's form. This meant that users could not set the value of `file_name_prefix` when making a new provider or when editing a provider who had no uploaded files. This PR adds the ability to set the `file_name_prefix` value on the provider form. The field will show on the form when the provider is... - A new instance - One who has no topics, and no uploaded files
a5f8785 to
cc33849
Compare
| <% end %> | ||
| <%= form.text_field :name, | ||
| placeholder: "Enter provider name (e.g., Johns Hopkins, Mayo Clinic)", | ||
| placeholder: "e.g., Johns Hopkins, Mayo Clinic", |
There was a problem hiding this comment.
Changed the placeholder here to be consistent with the rest of them. I think it is sufficient to have the placeholder give examples, as our help text says what the input should be
It should not be required. The prefix is included in the naming convention when present but the convention still works without it.
It was empty.
I do not remember the full arc offhand but I believe we removed the ability to edit it as a stopgap when we realized the effects of changing it would be bad. The file names on Azure differ from our local file names. The azure file names are computed when SkillRx takes any syncing action with Azure. So if we have files synched with Azure and we change the file_name_prefix, our computed name no longer matches what is in Azure. Existing files are left in Azure with the old names and SkillRx looks for the new names when trying to work with those files.
We should not. If a provider has existing files, they should not be able to change the file_name_prefix.
Listing the topics would likely be problematic; there can and will be a great many topics. But it's a very good idea to have a note explaining that the file names are established and that we therefore cannot change the file_name_prefix. |
What Issue Does This PR Cover, If Any?
Resolves #607
What Changed? And Why Did It Change?
Each provider has a
file_name_prefix. This value is added to the file namewhen the provider uploads a file. This
file_name_prefixis necessaryto coordinate between our file storage and Azure's. However, if a provider
was to change their
file_name_prefixwhen they had uploaded files,it would break management of those existing uploaded files.
Before, we got around this by simply removing the field from the provider's
form. This meant that users could not set the value of
file_name_prefixwhen making a new provider or when editing a provider who had no uploaded
files.
This PR adds the ability to set the
file_name_prefixvalue on theprovider form. The field will show on the form when the provider
is...
How Has This Been Tested?
RSpec and by verifying these test cases by hand...
the
file_name_prefixfieldand set the
file_name_prefixfieldand set the
file_name_prefixfieldPlease Provide Screenshots
The provider form, with the
file_name_prefix, for a new instanceThe provider form, with the
file_name_prefix, for editing an instance with no topicsAdditional Comments
Some questions...
file_name_prefixfield is not required. Should itbe required?
file_name_prefixwas unavailable to set on the form,what was its value set to for a new Provider? Was it empty? Was
it some default value?
file_name_prefixvalues were empty because of ourpast workaround, was this behaviour we wanted, or a tradeoff
to avoid the issue?
file_name_prefixis empty. Should we give the option to setthe
file_name_prefixhere?why the
file_name_prefixdoes not appear on their edit form and cannotbe changed? Would we like to make it more explicit, too? - could we have a
disabled field so we can still show the field on the form, but with a note
why it isn’t editable?
The current provider Show view - their topics are not listed